package com.hh.eduservice.controller;

import com.hh.commonutils.Result;
import com.hh.eduservice.entity.EduCourse;
import com.hh.eduservice.service.EduCourseService;
import com.hh.eduservice.service.EduTeacherService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.ArrayList;

@RestController
@RequestMapping("/eduservice/indexfront")
public class IndexFrontController {
    @Autowired
    private EduCourseService eduCourseService;
    @Autowired
    private EduTeacherService eduTeacherService;

    @GetMapping("index")
    public Result index(){
        ArrayList eduList = eduCourseService.getLimitEduCours();
        ArrayList teacherList = eduTeacherService.getLimitEduTeacher();
        return Result.success().data("eduList", eduList).data("teacherList", teacherList);
    }
}
